<?php

/* 需要下载 pb4php : http://code.google.com/p/pb4php/ */

require_once '../message/pb_message.php';
require_once 'User.php';


/* @var $g User */
$g = new User();

/* 获取消息 */

if(isset($_POST['message'])){
    $_base64_message = $_POST['message'];
    $message = base64_decode($_base64_message);
}else{
    $message = file_get_contents('User.pb');
}
echo base64_encode($message);

/* 解析消息 */
$g->ParseFromString($message);

foreach($g->values as $key => $pbobject)
{
    //var_dump($pbobject->value);
}
?>